/*
 * @Description: 就是一个编码添加
 */
import zhreq from "@/api/axios";
export default {
  onlyadd(params, noType) {
    return zhreq.post('/noService/configCode/add', {
      "noRule": `${params}`,
      "cumulativeNum": 0,
      "noType": noType || 'TRACE',
      "organizationNo": sessionStorage.organizationNo,
      'cumulative': 0
    });
  },
  // 获取编码规则
  getcoderule(params) {
    return zhreq.post('/noService/configCode/queryByCondition', {
      // "farmingTypeNo": sessionStorage.farmingTypeNo
      "noType": params,
      "organizationNo": sessionStorage.organizationNo
    });
  },
  // 获取编码规则
  codeyByCondition(params) {
    return zhreq.post('/noService/noType/queryByCondition', {
      ...params,
      "organizationNo": sessionStorage.organizationNo
    });
  },

  // 添加一条编码数据，获取返回的编码
  addcode(noType) {
    let no = noType || 'TRACE'
    return zhreq.get(`/noService/configCode/generateNo?organizationNo=${sessionStorage.organizationNo}&noType=${no}`);
    // return zhreq.post("/batchNo/add", {
    //   "companyId": sessionStorage.companyId,
    //   "organizationNo": sessionStorage.organizationNo
    // });
  }
}
